package com.ycrlkj.android.modulescore.main.apiservice;

import com.ycrlkj.android.modulespublic.common.net.response.MResponse;
import com.ycrlkj.android.modulescore.main.entity.Vehicle;
import com.ycrlkj.android.modulespublic.common.net.response.ResultData;

import java.util.List;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;


/**
 * 复制此类时说明:
 * 注意: 每新增一个 XXXXApiService 文件需要向 ApiServiceModule 中添加一个注入的生产者
 */
public interface WxApiService {

    @GET("vehicle/getAll")
    Observable<MResponse<List<Vehicle>>> getAll();

    @POST("vehicle/add")
    @FormUrlEncoded
    Observable<MResponse<ResultData>> add(@Field("vehicle") Vehicle vehicle);

    @GET("https://api.weixin.qq.com/sns/oauth2/access_token")
    Observable<MResponse<String>> getToken(@Query("appid") String appid);

    @GET("https://api.weixin.qq.com/sns/userinfo")
    Observable<MResponse<String>> getUseInfo(@Query("access_token") String access_token);

    @POST("http://api.dev.myapi.cn/login/wx/")
    Observable<MResponse<String>> MyLogin(@Field(encoded =true,value ="userinfo") String userinfo);


}
